#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int main(void)
{
    srand(time(NULL));
    int num = rand() % 100;

    int n, step = 3;
    do {
        printf("输入一个数字：\n");
        scanf("%d", &n);

        if (n > num) {
            printf("数字大了！\n");
        }
        else if (n < num) {
            printf("数字小了！\n");
        }
        else {
            printf("厉害啊，你猜对了！！！\n");
            return 0;
        }
        step--;
    } while(step);

    printf("还得练啊，老弟！答案是%d\n", num);

    return 0;
}
